export default (key, name, type) => {
    if (!type) type = "activiti";
    const TYPE_TARGET = {
        activiti: "http://activiti.org/bpmn",
        camunda: "http://bpmn.io/schema/bpmn",
        flowable: "http://flowable.org/bpmn"
    };
    return `<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
  xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
  xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
  xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
  id="diagram_${key}"
  targetNamespace="${TYPE_TARGET[type]}">
  <bpmn2:process id="${key}" name="${name}" isExecutable="true">
    <bpmn2:startEvent id="Event_12sjbuc">
      <bpmn2:outgoing>Flow_035p32z</bpmn2:outgoing>
    </bpmn2:startEvent>
    <bpmn2:task id="Activity_1cab5pw">
      <bpmn2:incoming>Flow_035p32z</bpmn2:incoming>
      <bpmn2:outgoing>Flow_163rk7c</bpmn2:outgoing>
    </bpmn2:task>
    <bpmn2:sequenceFlow id="Flow_035p32z" sourceRef="Event_12sjbuc" targetRef="Activity_1cab5pw" />
    <bpmn2:task id="Activity_1ubm8oc">
      <bpmn2:incoming>Flow_163rk7c</bpmn2:incoming>
      <bpmn2:outgoing>Flow_1639biw</bpmn2:outgoing>
    </bpmn2:task>
    <bpmn2:sequenceFlow id="Flow_163rk7c" sourceRef="Activity_1cab5pw" targetRef="Activity_1ubm8oc" />
    <bpmn2:task id="Activity_0ryj64f">
      <bpmn2:incoming>Flow_1639biw</bpmn2:incoming>
      <bpmn2:outgoing>Flow_01sypzr</bpmn2:outgoing>
    </bpmn2:task>
    <bpmn2:sequenceFlow id="Flow_1639biw" sourceRef="Activity_1ubm8oc" targetRef="Activity_0ryj64f" />
    <bpmn2:endEvent id="Event_0tj6sfc">
      <bpmn2:incoming>Flow_01sypzr</bpmn2:incoming>
    </bpmn2:endEvent>
    <bpmn2:sequenceFlow id="Flow_01sypzr" sourceRef="Activity_0ryj64f" targetRef="Event_0tj6sfc" />
  </bpmn2:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="${key}">
      <bpmndi:BPMNEdge id="Flow_035p32z_di" bpmnElement="Flow_035p32z">
        <di:waypoint x="218" y="140" />
        <di:waypoint x="270" y="140" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_163rk7c_di" bpmnElement="Flow_163rk7c">
        <di:waypoint x="370" y="140" />
        <di:waypoint x="430" y="140" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_1639biw_di" bpmnElement="Flow_1639biw">
        <di:waypoint x="530" y="140" />
        <di:waypoint x="590" y="140" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_01sypzr_di" bpmnElement="Flow_01sypzr">
        <di:waypoint x="690" y="140" />
        <di:waypoint x="752" y="140" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="Event_12sjbuc_di" bpmnElement="Event_12sjbuc">
        <dc:Bounds x="182" y="122" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1cab5pw_di" bpmnElement="Activity_1cab5pw">
        <dc:Bounds x="270" y="100" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_1ubm8oc_di" bpmnElement="Activity_1ubm8oc">
        <dc:Bounds x="430" y="100" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0ryj64f_di" bpmnElement="Activity_0ryj64f">
        <dc:Bounds x="590" y="100" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_0tj6sfc_di" bpmnElement="Event_0tj6sfc">
        <dc:Bounds x="752" y="122" width="36" height="36" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn2:definitions>`;
};